const express = require('express');
const { uploadSingle, uploadMinio, uploadQiniu } = require('../middleware/upload');
const { upload } = require('../controller/upload');
const AppError = require('../utils/AppError');
const router = express.Router();
// const fileUpload = require('express-fileupload');

// 但图片上传
router.post(
	'/',
	// fileUpload(),
	// (req, res, next) => {
	// 	const schema = req.joi.object({
	// 		file: req.joi.required()
	// 	});
	// 	const { error: failed } = schema.validate({ file: req?.files?.file });
	// 	if (failed) return next(new AppError(failed, 400));

	// 	next();
	// },
	uploadSingle(),
	// uploadQiniu,
	// uploadMinio,
	upload
);

module.exports = router;
